package org.wupgateway.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.config.ResourceHandlerRegistry;
import org.springframework.web.reactive.config.WebFluxConfigurer;

import java.io.File;

@Configuration
public class StaticResourceConfig implements WebFluxConfigurer {
	private final String BASE_URL = "file:" + System.getProperty("user.dir") + File.separator;
	
	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry
			.addResourceHandler("/ua/**")
			.addResourceLocations(BASE_URL + "data" + File.separator + "avatar" + File.separator);
	}
}
